package webstart;



import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

import com.diandian.util.VerbalAssociation;

/**
 * @description Start
 * @author TDW
 * @date 2018年6月14日
 *
 */
public class Start {

    public static void main(String[] args) throws Exception { 
        final int port = Integer.getInteger("port", 8888);
        final String contextPath = System.getProperty("context", "");
        Server server = new Server(port);
        WebAppContext context = new WebAppContext("src/main/webapp/", contextPath);
        context.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
        context.setInitParameter("org.apache.el.parser.COERCE_TO_ZERO", "true");
        System.setProperty("org.apache.el.parser.COERCE_TO_ZERO", "true");
        context.setDescriptor("src/main/webapp/WEB-INF/web.xml");
        server.setHandler(context);
        server.setStopAtShutdown(true);
        server.start();
        //错词库
        String wordsPath ="D:/workspace/ocr-util/src/main/webapp/WEB-INF/data";// new PathUtil().getWebInfPath();
        VerbalAssociation.init(wordsPath+"/verbalAssociation.words",wordsPath+"/firstCut.words");

    }
}